package com.tanhua.dubbo.api.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.domain.db.SoulQuestionReport;
import com.tanhua.dubbo.api.SoulQuestionReportApi;
import com.tanhua.dubbo.mapper.SoulQuestionReportMapper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class SoulQuestionReportApiImpl implements SoulQuestionReportApi {
    @Autowired
    private SoulQuestionReportMapper soulQuestionReportMapper;
    
    @Override
    public SoulQuestionReport findTestReport(Integer reportId) {
        QueryWrapper<SoulQuestionReport> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("report_id", reportId);
        
        return soulQuestionReportMapper.selectOne(queryWrapper);
    }
    
    /**
     * 根据报告id查询到报告
     *
     * @param reportId
     * @return
     */
    @Override
    public SoulQuestionReport findReport(Long reportId) {
        QueryWrapper<SoulQuestionReport> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("report_id", reportId);
        return soulQuestionReportMapper.selectOne(queryWrapper);
    }
}
